from django.conf.urls import url
from .views import LoginView,GradeView,LogoutView,RegisterView
from .views import AddGradeView,DeleteGrade,CourseListView,AddCourseView
from .views import DetailCourseView,DeleteCourseView,ResourceView,AddResourceView
from .views import DeleteResourceView,GradeStudentsView,AddGradeStudentsView,DeleteStudentsView
from .views import LessonView,AddLessonView,DeleteLessonView,VideoView,AddVideoView
from .views import DeleteVideoView,SendMessageView,MessageView,CreateExamView
from .views import ListExamView,ExamQuestionDetail, ActiveExam,UserAnalyseView
from .views import PaperScoreDetail,UserQuestionDetailView,ExamAnalyseView
from .views import CreateSignView,ListSignView,SignDetailView

urlpatterns = [
    url(r"^login",LoginView.as_view(),name="login"),
    url(r"^$",GradeView.as_view(),name="index"),
    url(r"^logout",LogoutView.as_view(),name="logout"),
    url(r"^register",RegisterView.as_view(),name="register"),
    url(r"^addgrade",AddGradeView.as_view(),name="addgrade"),
    url(r"^deletegrade/(?P<grade>\d+)",DeleteGrade.as_view(),name="deletegrade"),
    url(r"^course$",CourseListView.as_view(),name="course_list"),
    url(r"addcourse",AddCourseView.as_view(),name="add_course"),
    url(r"^course/(?P<course_id>\d+)",DetailCourseView.as_view(),name="course_detail"),
    url(r"^deletecourse/(?P<course_id>\d+)",DeleteCourseView.as_view(),name="delete_course"),
    url(r"^resources",ResourceView.as_view(),name="resource_list"),
    url(r"^addresources",AddResourceView.as_view(),name="add_resource"),
    url(r"^deleteresource/(?P<resource_id>\d+)",DeleteResourceView.as_view(),name="delete_resource"),
    url(r"^students",GradeStudentsView.as_view(),name="students"),
    url(r"^addstudents",AddGradeStudentsView.as_view(),name="add_student"),
    url(r"^deletestudent/(?P<student_id>\d+)",DeleteStudentsView.as_view(),name="delete_student"),
    url(r"^lessons",LessonView.as_view(),name="lesson_list"),
    url(r"^addlessons",AddLessonView.as_view(),name="add_lesson"),
    url(r"^delete_lesson/(?P<lesson_id>\d+)",DeleteLessonView.as_view(),name="delete_lesson"),
    url("^videos",VideoView.as_view(),name="video_list"),
    url("^addvideo",AddVideoView.as_view(),name="add_video"),
    url("^deletevideo/(?P<video_id>\d+)",DeleteVideoView.as_view(),name="delete_video"),
    url("^sendmessage",SendMessageView.as_view(),name="send_message"),
    url("^messages",MessageView.as_view(),name="message_list"),
    url("^createexame",CreateExamView.as_view(),name="create_exam"),
    url("^examelist",ListExamView.as_view(),name="list_exam"),
    url("^examdetail/(?P<exam_id>\d+)",ExamQuestionDetail.as_view(),name="exam_detail"),
    url("^activeexam/(?P<exam_id>\d+)",ActiveExam.as_view(),name="active_exam"),
    url("^analyse",UserAnalyseView.as_view(),name="analyse"),
    url("^paperdetail/(?P<exam_id>\d+)",PaperScoreDetail.as_view(),name="paperdetail"),
    url("^userscoredetail/(?P<user_id>\d+)/(?P<exam_id>\d+)",UserQuestionDetailView.as_view(),name="user_score_detail"),
    url("^exam_analyse/(?P<paper_id>\d+)",ExamAnalyseView.as_view(),name="exam_analyse"),
    url("^addsign",CreateSignView.as_view(),name="add_sign"),
    url("^signs",ListSignView.as_view(),name="sign_list"),
    url("^signdetail/(?P<sign_id>\d+)",SignDetailView.as_view(),name="sign_detail")
]